Skip to content

index migration issue from 1.6.0 to 1.6.x#76

Merged
christyjacob4 merged 4 commits into
utopia-php:mainfrom
ArnabChatterjee20k:fix/index-migration-issue-from-1.6.0
Apr 22, 2025
Merged

index migration issue from 1.6.0 to 1.6.x#76
christyjacob4 merged 4 commits into
utopia-php:mainfrom
ArnabChatterjee20k:fix/index-migration-issue-from-1.6.0

Conversation

@ArnabChatterjee20k
Copy link
Copy Markdown
Contributor

We dont have createdAt and updatedAt in 1.6.0 appwrite so during the migration they are turning out to be null
So if they are null turning them to current timestamp
https://linear.app/appwrite/issue/DAT-498/failed-self-hosted-migration

Comment thread src/Migration/Sources/Appwrite.php Outdated
Comment thread src/Migration/Sources/Appwrite.php Outdated
$response = $this->database->listIndexes($collection, $queries);

foreach ($response as $index) {
$createdAt = $index['$createdAt'];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$index['$createdAt'] Will be a string it maybe nulls not sure, so check for both with isEmpty

$index['$createdAt'] = empty($index['$createdAt']) ? DateTime::now() : $index['$createdAt'];

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

@ArnabChatterjee20k ArnabChatterjee20k force-pushed the fix/index-migration-issue-from-1.6.0 branch 2 times, most recently from 483afe7 to 2c43246 Compare April 21, 2025 04:22
@ArnabChatterjee20k ArnabChatterjee20k force-pushed the fix/index-migration-issue-from-1.6.0 branch from 2c43246 to 67edeaa Compare April 21, 2025 04:27
Comment thread src/Migration/Sources/Appwrite.php Outdated
@ItzNotABug ItzNotABug self-requested a review April 21, 2025 04:45
@christyjacob4 christyjacob4 merged commit 8a56e92 into utopia-php:main Apr 22, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants